<?php
//include DB configuration file
include('funct.php');
session_start();
//Connect to database
#mysql_connect($db_host, $db_user, $db_password);
#mysql_select_db($db_table);


#$title = mysql_real_escape_string($_POST['title']);
#$content = mysql_real_escape_string($_POST['content']);
$id = intval($_POST['article_id']);

//save contents to database
$dane['wywiad']=$_POST['wiz_wyw_opis'];
$dane['badanie']=$_POST['wiz_badanie_opis'];
$dane['zalecenia']=$_POST['wiz_zalecenia_opis'];
$pierwszy=$db->update("wizyty_inf", $dane, "id_wiz=".$id);


#$opis_bad=$_POST['wiz_badanie_opis'];
#$sql="update wizyty_inf set wywiad = '".mysql_real_escape_string($_POST['wiz_wyw_opis'])."', badanie = '".mysql_real_escape_string($opis_bad)."', zalecenia = 
#'".mysql_real_escape_string($_POST['wiz_zalecenia_opis'])."' where id_wiz=".$id;
#logg($sql, $_SESSION['u']);

#echo $sql;
#mysql_query($sql);

$data['icd10']=$_POST['icd10'];
$drugi=$db->update("wizyty_inf_dod", $data, "id_wizyty=".$id);

//get timestamp
#$result = mysql_query("SELECT timestamp FROM `a` WHERE id = $id");
#$timestamp = mysql_result($result, 0);

//output timestamp
if ($pierwszy<>0 && $drugi<>0) {
 echo 'Automatyczny zapis: ', date("H:i:s");   
}

?>